package com.imooc.spring.mvc.controller;

import com.imooc.spring.mvc.entity.Form;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.List;
import java.util.Map;

/**
 * Created by pc on 2021/2/23 22:42
 * Description: s02
 */

@Controller
public class FormController {

   /* @PostMapping("/apply")
    @ResponseBody
    public String apply(@RequestParam(value = "name",defaultValue = "Anon") String abc, String course, Integer[] purpose) {


        System.out.println(abc);
        System.out.println(course);
        System.out.println(purpose);
        for (Integer p : purpose) {
            System.out.println(p);
        }

       return "Success";
    }*/

  /*  @PostMapping("/apply")
    @ResponseBody
    public String apply(String name, String course,@RequestParam List<Integer> purpose) {


        System.out.println(name);
        System.out.println(course);
        System.out.println(purpose);
        for (Integer p : purpose) {
            System.out.println(p);
        }

        return "Success";
    }*/


   /* @PostMapping("/apply")
    @ResponseBody
    public String apply(Form form) {

        return "Success";
    }*/

    @PostMapping("/apply")
    @ResponseBody
    public String apply(@RequestParam Map map) {
        System.out.println(map);
        return "Success";
    }



}
